package com.i2.test.core;

import java.lang.reflect.Field;

public class Reader {

	
	public String reader(Class<?> clzz)
	{
		String field_str=new String("{");
		Class<?> cleass=clzz;
		Field[] fields=cleass.getDeclaredFields();
		for(Field field:fields)
		{
			field.setAccessible(true);
			field_str+=field.getName()+",";
			if(!isJavaClass(field.getType())) {
				reader(field.getType());
			}
		}
		field_str=field_str.substring(0,field_str.length()-1);
		field_str+="}";
		return field_str;
	}
	
	private boolean isJavaClass(Class<?> clzz)
	{
		return clzz != null && clzz.getClassLoader() == null; 
	}
	
	
}
